package work04game;

import java.util.Random;

public class Equipment {
    private int ATK;
    private String name;
    private int DEF;
    private int HP;
    private int MP;

    public int getATK() {
        return ATK;
    }

    public void setATK(int ATK) {
        this.ATK = ATK;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getDEF() {
        return DEF;
    }

    public void setDEF(int DEF) {
        this.DEF = DEF;
    }

    public void GetSword(){
        Random rand = new Random();
        int i = rand.nextInt(3);
        if(i==0){
            ATK = rand.nextInt(6)+3;//3-8
            name = "木剑";
            DEF =0;
        }
        else if(i==1){
            ATK = rand.nextInt(8)+5;//5-12
            name = "石剑";
            DEF = 0;
        }
        else{
            ATK = rand.nextInt(11)+8;//8-18
            name = "铁剑";
            DEF = 0;
        }
    }

    public void GetArmour(){
        Random rand = new Random();
        int i = rand.nextInt(2);
        if(i==0){
            DEF = rand.nextInt(3)+3;//3-7
            name = "轻甲";
        }
        else{
            DEF = rand.nextInt(7)+5;//6-15
            name = "重甲";
        }
    }
    public void AddLotion(){
        HP = 10;
        MP = 10;
        name = "药瓶";
    }

    public int getMP() {
        return MP;
    }

    public void setMP(int MP) {
        this.MP = MP;
    }

    public int getHP() {
        return HP;
    }

    public void setHP(int HP) {
        this.HP = HP;
    }
}

